문제집. - ZOJ. [ZOJ3949 The 17th Zhejiang University Programming Contest B] [트리 DP] Edge to the Root 트리에 한 쪽 뿌리 거리의 합을 최대한 작게 Given a tree with n vertices, we want to add an edge between vertex 1 and vertex x, so that the sum of d(1, v) for all vertices v in the tree is minimized, where d(u, v) is the minimum number of edges needed to pass from... 문제집. - ZOJ.동적 계획 - 트리 DP
[ZOJ3949 The 17th Zhejiang University Programming Contest B] [트리 DP] Edge to the Root 트리에 한 쪽 뿌리 거리의 합을 최대한 작게 Given a tree with n vertices, we want to add an edge between vertex 1 and vertex x, so that the sum of d(1, v) for all vertices v in the tree is minimized, where d(u, v) is the minimum number of edges needed to pass from... 문제집. - ZOJ.동적 계획 - 트리 DP